import { getLanguage } from '@/initialize/locales';

const state = {
  language: getLanguage(),
  user:{}
};

const mutations = {
  setState: (state, obj) => {
    Object.keys(obj).forEach((key)=> state[key] = obj[key])
  },
};

const actions = {
  setLanguage({ commit }, language) {
    commit('SET_LANGUAGE', language);
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
